var fs = require('fs')
var path = require('path')

var rs = fs.createReadStream(path.join(__dirname, 'input.txt'))
var count = 0
var str = ''

rs.once('open', function() {
  console.log('文件打开了')
});

rs.once('close', function() {
  console.log('文件关闭了')
})

rs.on('data', function(data) {
  console.log(data.length)
  str += data
  count++
})

rs.once('end', function() {
  console.log(str)
  console.log(count);
})
